#include<iostream>
#include<cstring>
#include<algorithm>

using namespace std;

const int N=1e5+10;

int s[N],a[N],n;

int main()
{
    scanf("%d\n",&n);

    long long p=0,q=0;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
        s[i]=a[i]-a[i-1];
    }

    for(int i=2;i<=n;i++)
    {
        if(s[i]>0) p+=s[i];
        else q-=s[i];
    }
    printf("%lld\n",max(p,q));
    printf("%lld\n",abs(q-p)+1);

    return 0;
}
